package cn.wolfcode.trip.base.domain;

import com.alibaba.druid.support.json.JSONUtils;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/*
* 酒店房间
* */
@Getter @Setter
public class Room extends BaseDomain {

    public static final Integer TYPE_SINGLE=1;//单人房
    public static final Integer TYPE_DOUBLE=2;//双人房
    public static final Integer TYPE_PRESIDENT=3;//总统套房

    public static final Integer STATE_DIABLE=0;//不可用
    public static final Integer STATE_AVAILABLE=1;//可用

    //房间所属的酒店
    private Hotel hotel;

    //房间类型
    private Integer type;

    //房间价格
    private Double price;

    //房间状态
    private Integer state;

    //房间图片
    private String coverUrl;

    //房间总数
    private Integer sum;

    public String getTypeName(){
        String temp = "单人房";
        if(type == TYPE_DOUBLE){
            temp = "双人房";
        }else if(type == TYPE_PRESIDENT){
            temp = "总统套房";
        }
        return temp;
    }

   /*public String getJson(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",getId());
        map.put("hotel",hotel);
        map.put("typeName",getTypeName());
        map.put("price",price);
        return JSONUtils.toJSONString(map);
    }*/


}